#!/usr/bin/env python2.7

# bender.py

import os, sys
#import re
#from datetime import datetime, timedelta
#from dateutil.parser import parse
import numpy as np
import matplotlib
matplotlib.use('Qt4Agg')
matplotlib.rcParams['backend.qt4']='PySide'
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure

#from mpl_toolkits.basemap import Basemap
#from matplotlib import mlab
#from netCDF4 import Dataset
from PySide.QtCore import *
from PySide.QtGui import *
from ui_filer import *

class Filer(QWidget, Ui_FileWidget):
    def __init__(self, parent=None):
        super(Filer, self).__init__(parent)
        self.setupUi(self)
        self.parent = parent

    @property
    def settingfname(self):
        return self.settingfnameEdit.text()

    @settingfname.setter
    def settingfname(self, value):
        self.settingfnameEdit.setText(value)

    @property
    def fname(self):
        return self.fnameEdit.text()

    @fname.setter
    def fname(self, value):
        self.fnameEdit.setText(value)

    @property
    def dirname(self):
        return self.dirEdit.text()

    @dirname.setter
    def dirname(self, value):
        self.dirEdit.setText(value)

    @property
    def prefixrcs(self):
        return self.prefixrcsEdit.text()

    @prefixrcs.setter
    def prefixrcs(self, value):
        self.prefixrcsEdit.setText(value)

    @property
    def prefixgrad(self):
        return self.prefixgradEdit.text()

    @prefixgrad.setter
    def prefixgrad(self, value):
        self.prefixgradEdit.setText(value)

    @property
    def prefixpeak(self):
        return self.prefixpeakEdit.text()

    @prefixpeak.setter
    def prefixpeak(self, value):
        self.prefixpeakEdit.setText(value)

    @property
    def prefixbump(self):
        return self.prefixbumpEdit.text()

    @prefixbump.setter
    def prefixbump(self, value):
        self.prefixbumpEdit.setText(value)

    @property
    def subdir(self):
        return self.subdircheckBox.isChecked()

    @subdir.setter
    def subdir(self, value):
        state = Qt.Checked if value else Qt.Unchecked
        self.subdircheckBox.setCheckState(state)

if __name__ == '__main__':
    pass
